package com.zlw.test.controller;

import com.zlw.framework.beans.Autowired;
import com.zlw.framework.web.mvc.Controller;
import com.zlw.framework.web.mvc.RequestMapping;
import com.zlw.framework.web.mvc.RequestParam;
import com.zlw.test.service.SalaryService;

/**
 * @ClassName SalaryController
 * @Description TODO
 * @Author zhaoluowei
 * @Date 2020/1/28  18:02
 * @Version 1.0
 */

@Controller
public class SalaryController {

    @Autowired
    private SalaryService salaryService;


    @RequestMapping(value = "/getSalary")
    public Integer getSalary(@RequestParam("name") String name,
                             @RequestParam("age") String age) {
        System.out.println("我进来了");
        //通过反射进行 赋值
        System.out.println("param -- name : " + name);
        System.out.println("param -- age : " + age);
        return salaryService.calSalary(Integer.parseInt(age));
    }


    @RequestMapping(value = "/getSalary2")
    public Integer getSalary2(@RequestParam("name") String name,
                              @RequestParam("age") String age) {
        System.out.println("getSalary2 is coming 。。。");

        return 0;
    }

}
